package ysq.xyg.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ysq.xyg.dao.ItemDao;
import ysq.xyg.model.Item;
import ysq.xyg.service.ItemService;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品分类实现
 *
 * @author congcong tao
 * @date 2018/8/7 11:46
 */
@Service("ItemService")
public class ItemServiceImpl extends BaseServiceImpl<Item> implements ItemService {

    @Resource
    private ItemDao itemDao;
    @Autowired
    public void setItemDao(ItemDao itemDao) {
        this.baseDao = itemDao;
    }

    @Override
    public PageInfo<Item> pageInfo(Item item, int pageSize, int pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        List<Item> list = itemDao.selectItemAndCat(item);
        return new PageInfo<Item>(list);
    }
}
